package com.qqtem.grupo14;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Help extends Activity {
	// Key for startActivity
    public static final String NUM_TELA = "numtela";
    
    // Screens IDs
    public static final int TELA_CADASTRO_LOCAL = 1;
    public static final int TELA_CADASTRO_USER = 2;
    public static final int TELA_DETALHE_LOCAL = 3;
    
    // Screen that called me
    private int tela;
    
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.help);
        
        Bundle extras = getIntent().getExtras();
        tela = extras != null ? extras.getInt(NUM_TELA) : null;
    	
        // Set Screen Title
        setTitle(R.string.help_title);  
		
        // Grab TextViews
    	TextView title = (TextView) findViewById(R.id.help_title);
    	TextView text = (TextView) findViewById(R.id.help_text);
    	
    	// Set Title and Text according to the screen
        switch(tela){
        case TELA_CADASTRO_LOCAL:
        	title.setText(R.string.help_add_local_title);
        	text.setText(R.string.help_add_local_text);
        	break;
        case TELA_CADASTRO_USER:
        	break;
        case TELA_DETALHE_LOCAL:
        	break;
        }	

        // Set OnClick for OK Button
        Button okButton = (Button) findViewById(R.id.help_button_ok);
        okButton.setOnClickListener(new View.OnClickListener() {

        	public void onClick(View view) {
        	    setResult(RESULT_OK);
        	    finish();
        	}

        });
        
    }
}
